import {h} from "vue";
import {NTag} from "naive-ui";

export const columns = [
  {
    title: '姓名',
    key: 'name',
  },
  {
    title: '部门',
    key: 'dept',
  },
  {
    title: '标题',
    key: 'prompt',
  },
  {
    title: '反馈',
    key: 'feedback',
    render(row) {
      return h(
          NTag,
          {
            type: row.feedback >= 2 ? 'success' : 'error',
          },
          {
            default: () => (row.feedback === 1 ? '差' : row.feedback === 2 ? '中' : row.feedback === 3 ? '好' : '未评价'),
          }
      );
    },
  },
  {
    title: '推荐',
    key: 'refer_status',
    render(row) {
      return h(
          NTag,
          {
            type: row.refer_status === 1 ? 'success' : 'error',
          },
          {
            default: () => (row.refer_status === 1 ? '是' : '否'),
          }
      );
    },
  },
  {
    title: '时间',
    key: 'dateTime',
  },
];
